<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
  <head>
    <base href="<%=basePath%>" />
    <title>Data Collection Information of Heat Meter</title>
    <script type="text/javascript">
		var path = "<%=basePath%>";
	</script>
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
	<meta http-equiv="description" content="This is my page" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>beshs/css/content.css" />
	<link type="text/css" href="<%=basePath%>beshs/css/frame_style.css" rel="stylesheet" />
	<link type="text/css" href="<%=basePath%>beshs/css/element_style.css" rel="stylesheet" />
	<script type="text/javascript" src="<%=basePath%>resources/jquery/jquery-1.7.2.min.js"></script>
	<!-- 页面特效 -->
	<jsp:include page="/beshs/res-refer/page-effect-reference.jsp" />
	<!-- 系统通用资源 -->
	<jsp:include page="/resources/resource-refer/common-resource-reference.jsp" />
	<!-- 用户访问菜单路径 -->
	<jsp:include page="/resources/usertrace/common-uservisit-reference.jsp" />
	<!-- iframe高度自适应 -->
	<script type="text/javascript">
        function getOsName() { 
    		var OsObject = ""; 
		   	if(navigator.userAgent.indexOf("MSIE")>0) { 
		    	return "MSIE"; 
		   	} 
		   	if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 
		        return "Firefox"; 
		   	} 
		   	if(isSafari=navigator.userAgent.indexOf("Safari")>0) { 
		        return "Safari"; 
		   	}  
		  	if(isCamino=navigator.userAgent.indexOf("Camino")>0){ 
		        return "Camino"; 
		   	} 
		   	if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){ 
		        return "Gecko"; 
		   	} 
		} 
        
        /** 根据浏览器类型选择iframe自适应方式 **/
        function setIframeHeightAutosize() {
        	//获取Iframe对象 ie和firefox都可以获得
        	var listIframe = document.getElementById("meterDataPage"); 
        	try{
                if(getOsName() == 'MSIE'){
                	//列表
                    var lbHeight = listIframe.document.body.scrollHeight; //IE
                    listIframe.style.height =  lbHeight + "px"; 
                }else if(getOsName() == 'Firefox'){
                	//列表
                    var lfHeight = listIframe.contentDocument.body.scrollHeight; //FireFox 
                    listIframe.height = lfHeight + "px";   
                } else {
                    listIframe.style.height = 400 + "px";
                }          
            } catch (ex){}
		}
		function excelExport() {
			var meterDataUID = "<s:property value='meterDataUID' />";
			var meterNo = "<s:property value='meterData.meterNo' />";
			var recordTime = "<s:date name='meterData.recordTime' format='yyyy-MM-dd' nice='false' />";
				window.open(path + "beshs/heatMeterDataGatherAction!exportHeatMeterDataDetail.do?meterDataUID="+meterDataUID
					+"&meterNo="+meterNo+"&recordTime="+recordTime+"&date="+new Date(), "__self");
		}
		$(function() {
			setIframeHeightAutosize();
		})
    </script>
  </head>
  <body>
  	<div class="content_all">
  		<!--导航条-->
  		<div class="insertinfo_table">
		  	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		  		<tr>
		  			<th style="text-align: center;" colspan="8" >Data Collection Information of Heat Meter</th>
		  		</tr>
		  		<tr>
		          	<th>Project：</th>
          			<td><s:property value="project.projectName" /></td>
          			<th>District：</th>
          			<td><s:property value='community.communityName' /></td>
		        	<th>Building：</th>
		        	<td><s:property value='building.buildingID' /></td>
		  		</tr>
		  		<tr>
		  			<th>Shared Area：</th>
		          	<td><s:property value='shareArea.areaName' /></td>
		        	<th>Heat Meter No.：</th>
		        	<td><s:property value='meterData.meterNo' /></td>
		        	<th>Meter Reading Time：</th>
		          	<td><s:date name='meterData.recordTime' format='yyyy-MM-dd HH:mm:ss' nice='false' /></td>
		        </tr>
		        <tr>
		        	<th>Type：</th>
		        	<td><s:property value='heatMeter.meterType' /></td>
		        	<th>Pipe Size：</th>
		        	<td><s:property value='heatMeter.pipeDiameter' /></td>
				    <th>Heat Meter Aperture：</th>
				    <td><s:property value='heatMeter.meterDiameter' /></td>
		        </tr>
		        <tr>
		  			<th>Accumulated Heat：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
				        	<s:param value='meterData.sumHeat' />
				        </s:text>
		          		<s:if test="meterData.sumHeatUnit==1">MWh</s:if>
		          		<s:if test="meterData.sumHeatUnit==2">kWh</s:if>
		          		<s:if test="meterData.sumHeatUnit==3">Gj</s:if></td>
		        	<th>Accumulated Flow：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
				        	<s:param value='meterData.sumFlow' />
				        </s:text>
		          		<s:if test="meterData.sumFlowUnit==1">m&sup3;</s:if>
		          		<s:if test="meterData.sumFlowUnit==2">dm&sup3;</s:if>
		          		<s:if test="meterData.sumFlowUnit==3">cm&sup3;</s:if></td>
		          	<th>Instantaneous Flow：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
				        	<s:param value='meterData.instantFlow' />
				        </s:text>
		          		<s:if test="meterData.sumFlowUnit==1">m&sup3;/h</s:if>
		          		<s:if test="meterData.sumFlowUnit==2">dm&sup3;/h</s:if>
		          		<s:if test="meterData.sumFlowUnit==3">cm&sup3;/h</s:if></td>
		        </tr>
		        <tr>
		          	<th>Heat on Settlement Day：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
				        	<s:param value='meterData.settleAccountHeat' />
				        </s:text>
		          		<s:if test="meterData.settleAccountHeatUnit==1">MWh</s:if>
		          		<s:if test="meterData.settleAccountHeatUnit==2">kWh</s:if>
		          		<s:if test="meterData.settleAccountHeatUnit==3">Gj</s:if></td>
		          	<th>Heat Power：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
				        	<s:param value='meterData.heatPower' />
				        </s:text>
		          		<s:if test="meterData.heatPowerUnit==1">MW</s:if>
		          		<s:if test="meterData.heatPowerUnit==2">kW</s:if>
		          		<s:if test="meterData.heatPowerUnit==3">Gj/h</s:if></td>
		          	<th>Instantaneous Power：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
				        	<s:param value='meterData.instantPower' />
				        </s:text>
		          		<s:if test="meterData.heatPowerUnit==1">MW</s:if>
		          		<s:if test="meterData.heatPowerUnit==2">kW</s:if>
		          		<s:if test="meterData.heatPowerUnit==3">Gj/h</s:if></td>
		        </tr>
		        <tr>
		        	<th>Temperature of Supply Water：</th>
		          	<td><s:property value='meterData.supplyTemperature' />&nbsp;&#8451;</td>
          			<th>Temperature of Return Water：</th>
		          	<td><s:property value='meterData.backTemperature' />&nbsp;&#8451;</td>
		          	<th>Temperature Difference between Supply Water and Return Water：</th>
		          	<td><s:property value='meterData.temperatureDiff' />&nbsp;&#8451;</td>
		        </tr>
		        <tr>
		        	<th>Accumulated Operating Time：</th>
		          	<td><s:property value='meterData.runHours' />&nbsp;h</td>
          			<th>Accumulated Error Time：</th>
		          	<td><s:property value='meterData.wrongHours' />&nbsp;h</td>
		          	<th>Fault Information：</th>
          			<td><s:property value='meterData.wrongInfo' /></td>
		        </tr>
		        <tr>
		        	<th>Remark：</th>
          			<td colspan="3" style="white-space:normal; word-break:break-all; word-wrap:break-word;">
          				<s:property value='meterData.remark' />
          			</td>
          			<td colspan="2">
		          		<script type="text/javascript">
          					$(function() {
          						$("input[name='goBack']").click(function() {
//           							window.location = path + "beshs/heatMeterDataGatherAction!queryMeterDataPage.do?date="+new Date();
// 										window.close();
          							window.history.go(-1);
          						});
          					})
          				</script>
            			<input name="goBack" type="button" value="Return" class="s_btn"/>
            			<input name="excelExport" type="button" value="Data Export" id="excelExport" onclick="excelExport()" class="s_btn"/>
            			</td>
		        </tr>
		    </table>
		</div> 
	</div>
	<div class="clear"></div>
	<div class="content_all">
		<script type="text/javascript">
			$(function() {
  				//热量表分时数据的批次查询
  				var meterNo = "<s:property value='meterData.meterNo' />";
  				var recordTime = "<s:date name='meterData.recordTime' format='yyyy-MM-dd' nice='false' />";
  				window.frames["meterDataPage"].location = path + "interfaces/heatMeterData24GatherAction!queryMeterDataList4Statis.do?date="+new Date()
  						+"&meterNo="+meterNo
  						+"&recordTime="+recordTime;
  			});
		</script>
  		<iframe frameborder="0" scrolling="auto" name="meterDataPage" id="meterDataPage" src="" height="100%" width="100%"></iframe>
	</div>
  </body>
</html>
